package cn.sail.shiroAuthenticator.service.impl;

import cn.sail.shiroAuthenticator.dao.UserMapper;
import cn.sail.shiroAuthenticator.pojo.entity.User;
import cn.sail.shiroAuthenticator.service.UserService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User selectByUserName(String userName) {
        QueryWrapper userQueryWrapper = new QueryWrapper<>();
        User user = new User();
        user.setUserName(userName);
        userQueryWrapper.setEntity(user);
        User dbUser = userMapper.selectOne(userQueryWrapper);
        return dbUser;
    }
}
